/*************************************************************************
	> File Name: 1307.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-11 10:18:06
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int reverse_num(int n) {
    int ans = 0;
    while (n) {
        ans = ans * 10 + n % 10;
        n /= 10;
    }
    return ans;
}

int main() {
    int n;
    cin >> n;
    int res = reverse_num(n);
    cout << res << endl;
    return 0;
}
